//
//  ViewController.m
//  小游戏
//
//  Created by 宋 on 16/3/3.
//  Copyright © 2016年 宋. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"xiao.jpg"]];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)randhero {
//获取随机数
    int imageId = arc4random()%24 + 1;
    
    NSString *imagename = [NSString stringWithFormat:@"%d.jpg",imageId ];
    self.myImageView.image = [UIImage imageNamed:imagename];
    
    [self.view endEditing:YES];

}
@end
